package org.zookeeper.study;
/** 
* @author James
* @date 2018年8月16日 
*/
public class ZKClientTest {

	public static void main(String[] args) {
		String rootPath="/pay";
		//ZKOperate操作
		ZKOperate zkWatchAPI=new ZKOperate();
		//链接zk服务器
		MyZookeeper zookeeper=new MyZookeeper();
		zookeeper.connect("192.168.25.177:2181");
		
		//创建节点数据
//		if(zkWatchAPI.createZNode(rootPath, "/http://www.baidu.com")) {
//			System.out.println("节点："+rootPath+"，数据内容，"+zkWatchAPI.readData(rootPath));
//		}
		String path="/test/a/b";
		if(zkWatchAPI.createZNode(path, "/http://www.baidu.com")) {
			System.out.println("节点："+path+"，数据内容，"+zkWatchAPI.readData(path));
		}
		zookeeper.close();
	}
}
